/**
 * @param {string} s
 * @return {string}
*/
var replaceSpace = function(s) {
  const reg = /\s/g;
  s = s.replace(reg, (...payload) => {
    return "%20"
  });
  return s;
};
let s = "We are happy.";
console.log(replaceSpace(s));
